KEXEC: prevent panic on the kexec path when talking to the DMAR
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 16 Jun 2011 15:11:13 +0000 (16:11 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 16 Jun 2011 15:11:13 +0000 (16:11 +0100)
hardware

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/drivers/passthrough/vtd/dmar.h

index 982324ee6393f582d52e3581ad8cd68428d7a963..99182a8a4a412c6dc1f94464ef610ec3c0030f7f 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <xen/list.h>
 #include <xen/iommu.h>
+#include <xen/kexec.h>
 
 /* This one is for interrupt remapping */
 struct acpi_ioapic_unit {
@@ -98,9 +99,13 @@ do {                                                \
         sts = op(iommu->reg, offset);               \
         if ( cond )                                 \
             break;                                  \
-        if ( NOW() > start_time + DMAR_OPERATION_TIMEOUT )      \
-            panic("%s:%d:%s: DMAR hardware is malfunctional\n", \
-                  __FILE__, __LINE__, __func__);                \
+        if ( NOW() > start_time + DMAR_OPERATION_TIMEOUT ) {    \
+            if ( !kexecing )                                    \
+                panic("%s:%d:%s: DMAR hardware is malfunctional\n",\
+                      __FILE__, __LINE__, __func__);            \
+            else                                                \
+                break;                                          \
+        }                                                       \
         cpu_relax();                                            \
     }                                                           \
 } while (0)